﻿#      An Ordinary Idle Garden
#        by Cratmang

# This game and its content is distributed under a Creative Commons 0 "No Rights Reserved" License. Enjoy!

# Intended Colours:
#  Background: #c7f0d8
#  Everything else: #43523d

# Recommended Speed: 200 Cycles/Frame. 
# If you set it any slower, you may find this game will be going for a LOOONNNGG time.
# You COULD crank it up to ludicrous speed, but that would kind of ruin the fun in waiting, wouldn't it?

:const WIDTH  84
:const HEIGHT 48
:const TOP     8
:const LEFT   22
:calc  BOTTOM { TOP  + HEIGHT }
:calc  RIGHT  { LEFT + WIDTH  }

:alias frame vd #Every time frame = 0, timer goes up by 1
:alias timer ve
:alias lookingAtGarden vc #0 = false, 1 = true

: font
	0x40 0xA0 0xE0 0xA0 0xA0  0x80 0x80 0xC0 0xA0 0xC0  0x60 0x80 0x80 0x80 0x60  0xC0 0xA0 0xA0 0xA0 0xC0 # A B C D
	0xE0 0x80 0xE0 0x80 0xE0  0x60 0x40 0xE0 0x40 0x40  0xE0 0x80 0x80 0xA0 0xE0  0x80 0x80 0xC0 0xA0 0xA0 # E F G H
	0x40 0x00 0x40 0x40 0x40  0xE0 0x40 0x40 0x40 0xC0  0xA0 0xA0 0xC0 0xA0 0xA0  0x80 0x80 0x80 0x80 0xE0 # I J K L
	0x00 0x00 0xC0 0xA0 0xA0  0x00 0xE0 0xa0 0xE0 0x00  0xC0 0xA0 0xC0 0x80 0x80  0xE0 0xA0 0xA0 0xC0 0x20 # N O P Q
	0x00 0x00 0xC0 0x80 0x80  0xC0 0x80 0xC0 0x40 0xC0  0xE0 0x40 0x40 0x40 0x40  0x00 0x00 0xA0 0xA0 0xE0 # R S T U
	0xA0 0xA0 0xA0 0xA0 0x40  0x00 0xA0 0x40 0xA0 0x00  0xA0 0xA0 0x40 0x40 0x40  0xE0 0x20 0x40 0x80 0xE0 # V X Y Z
	0x40 0x40 0x40 0x00 0x40  0x00 0x00 0x00 0x00 0x40  0xC0 0x20 0x60 0x00 0x40  0x40 0xC0 0x40 0x40 0xE0 # ! . ? 1
	0xC0 0x20 0x60 0x80 0xE0  0xC0 0x20 0xC0 0x20 0xC0  0x20 0xA0 0xE0 0x20 0x20  0xE0 0x80 0xC0 0x20 0xC0 # 2 3 4 5
	0x60 0x80 0xE0 0xA0 0xE0  0xE0 0x20 0x40 0xE0 0x40  0xE0 0xA0 0x40 0xA0 0xE0  0xE0 0xA0 0xE0 0x20 0x20 # 6 7 8 9
	0xE0 0xA0 0xA0 0xA0 0xE0  0x00 0x40 0x00 0x40 0x00  0x40 0x80 0x80 0x80 0x40  0x40 0x20 0x20 0x20 0x40 # 0 : ( )
	
# M and W are near-illegeble when they're only 3 pixels wide, so I'm seperating them from the rest of the font.
: fontMW 
	0xF0 0xA8 0xA8 0xA8 0xA8  0x88 0xA8 0xA8 0xA8 0x50 
	
:stringmode text "ABCDEFGHIJKLNOPQRSTUVXYZ!.?1234567890:()" {
	:calc addr { font + VALUE * 5 }
	i := addr
	sprite v0 v1 5
	v0 += 4
}
:stringmode text "MW" {
	:calc addr { fontMW + VALUE * 5 }
	i := addr
	sprite v0 v1 5
	v0 += 6
}
:stringmode text " " { v0 += 3 }
:stringmode text "/" { v1 += 6 v0 := va }

: plantQ
	-1       0        0
# Planted  Growth   Time in this phase
# plant    Phase  
: plantW
	-1 0 0
: plantE
	-1 0 0
: plantA
	-1 0 0

: plantGrowthTimePerPhase 
	25 #Dandelion
	64 #Pumpkin
	100 #Lantern
	255 #Skeleton
	7 #Glitch

: plantBuyPrice
	#C  S  G
	 5  0  0   #Dandelion
	 2  3  0   #Pumpkin
	 0  25 0   #Lantern
	 0  7  2   #Skeleton
	 0  0  64 #Glitch
	 0  0  100 #Trophy (not a plant)

: plantSellPrice
	#C  S  G
	 30 0  0   #Dandelion
	 0  6  0   #Pumpkin
 	 0  45 0   #Lantern
   0  40 6   #Skeleton
	 0  12 64 #Glitch
	
: money
	20      0       0
# Copper  Silver  Gold
# 100 of the previous currency automatically converts into 1 of the next currency.
# To buy the trophy and win the game, you need 200 Gold. (Might change this later)

: moneyCounter 0 0 0

:macro writeDigit {
	sprite v0 v1 5
	v0 += 4
}

: countMoney
	i := moneyCounter
	bcd v5
	i := moneyCounter
	load v5 - v7
	if v5 != 0 begin
		i := hex v5
		writeDigit
	end
	i := hex v6
	writeDigit
	i := hex v7
	writeDigit
	;

: writeMoney #v0 = x, v1 = y, v2 v3 v4 = Copper Silver Gold, also uses v5 - v7 for counting money
	if v4 != 0 begin
		v5 := v4
		countMoney
		text "G "
	end
	if v3 != 0 begin
		v5 := v3
		countMoney
		text "S "
	end
	if v2 != 0 begin
		v5 := v2
		countMoney
		text "C "
	end
	;
	
: addMoney #Add funds stored in v5 - v7
	i := money
	load v2 - v4
	#Copper
	v2 += v5
	if v2 > 99 begin
		v2 -= 100
		v3 += 1
	end
	#Silver
	v3 += v6
	if v3 > 99 begin
		v3 -= 100
		v4 += 1
	end
	#Gold
	v6 := v4
	v4 += v7
		#Quick check to see if v4 didn't rollover from 255 back to 0.
	if v4 < v6 then v4 := 255
	save v2 - v4
;

: takeMoney #Same as :addMoney, but opposite effect
	i := money
	load v2 - v4
	#Copper
	v2 -= v5
	if v2 >= 100 begin #Remember that if the int goes below 0, it rolls back to 255
		v2 -= 155
		v3 -= 1
	end
	#Silver
	v3 -= v6
	if v3 >= 100 begin
		v3 -= 155
		v4 -= 1
	end
	#Gold
	v4 -= v7 
	save v2 - v4
;

: checkPlant
	getPlantPot
	load v2 - v3
	if v2 != -1 begin
		if v3 == 3 then sellPlant
		if v3 < 3 begin
			#Play error sound
			i := long sound-buzzer
			v2 := 3
			audio buzzer := v2
		end
	else
		lookingAtGarden := 0
	end
;

: sellPlant
	
	v9 := v2 #put the plant ID somewhere else so that we can use v2
	
	#Erase plant
	drawPlant
	
	#Erase money counter
	va := v0 #store v0 so that we can get it back later
	printMoneyOwned
	
	v0 := v5
	#Get the sell price
	i := plantSellPrice
	v5 := 0
	v6 := 3
	loop if v5 < v9 begin
		i += v6
		v5 += 1
	again end
	load v5 - v7
	addMoney
	
	#Now remove the plant from the pot
	v0 := va 
	v2 := -1
	v3 := 0
	v4 := 0
	getPlantPot
	save v2 - v4
	
	#Redraw plant (now an empty pot) and updated money count
	drawPlant
	printMoneyOwned
	
	#Play success jingle
	i := long sound-yay
	v2 := 8
	audio buzzer := v2
	
	
	#Loop to stop the game if the key is still being held
	v9 := key loop if v9 key then again
;

: main
	hires                    # Create border for Nokia screen (84x48px)
	plane 2                  #  Code by Internet Janitor
	i  := long block-16      #
	v1 := BOTTOM             #
	loop                     #
		sprite v0 v1 0         #
		v0 += 16               #
		if v0 != 128 then      #
	again                    #
	v1 := TOP                #
	loop                     #
	  i  := long block-16    #
		v0 := RIGHT            #
		sprite v0 v1 0         #
		v0 += 16               #
		sprite v0 v1 0         #
		v0 += 16               #
		i  := long block-12    #
		sprite v0 v1 0         #
		v1 += 16               #
		if v1 != BOTTOM then   #
	again                    #
	plane 1                  #
	
	#Draw Title screen
	i := titleScreen
	v0 := LEFT
	v1 := TOP
	:calc t1 { TOP + 16 } v2 := t1
	:calc t2 { TOP + 32 } v3 := t2
	v4 := 32
	loop
		sprite v0 v1 0  i += v4
		sprite v0 v2 0  i += v4
		sprite v0 v3 0  i += v4
		v0 += 16
		if v0 < RIGHT then
	again
	
	#Let the game begin!
	jump gameLoop
	
: gameLoop
	#Clean up everything if this is a restarted game
		v0 := 20 # Should be enough money to buy four dandelion seeds
		v1 := 0
		v2 := 0
		i := money
		save v2
		
		i := plantQ
		v0 := -1
		v1 := 0
		v2 := 0
		save v2
		i := plantW
		v0 := -1
		v1 := 0
		v2 := 0
		save v2
		i := plantE
		v0 := -1
		v1 := 0
		v2 := 0
		save v2
		i := plantA
		v0 := -1
		v1 := 0
		v2 := 0
		save v2
	
	:macro ReturnToGarden {
		v9 := key
		loop if v9 key then again
		clear
		garden
		printMoneyOwned
		lookingAtGarden := 1
	}
	ReturnToGarden
	drawTimer
	
	loop
		frame += 1
		
		if frame == 0 begin 
			drawTimer
			timer += 1
			drawTimer
			updatePlants
		end
		
		if lookingAtGarden == 1 begin
			v9 := OCTO_KEY_Q if v9 key begin
				v0 := 29
				checkPlant
			
			else v9 := OCTO_KEY_W if v9 key begin
				v0 := 49
				checkPlant
			
			else v9 := OCTO_KEY_E if v9 key begin
				v0 := 69
				checkPlant
			
			else v9 := OCTO_KEY_A if v9 key begin
				v0 := 89
				checkPlant
			end end end end
			
			if lookingAtGarden == 0 begin
				clear
				v9 := key loop if v9 key then again #This is to prevent weird stuff from happening if you accidentally hold the button down for more than a split second.
				v9 := v0
				v0 := 24
				va := v0
				v1 := 15
				text "BUY WHAT? X TO EXIT/Q: DANDELION......5C/W:PUMPKIN.....3S 2C/E: LANTERN.......25S/A: SKELETON....2G 7S/S: GLITCH........64G/D: TROPHY (WIN)  100G"
				printMoneyOwned
				va := v9
			end
		
		else # We are shopping!
			v9 := OCTO_KEY_Q if v9 key begin v8 := 0 buyPlant end  #q = dandelion
			v9 := OCTO_KEY_W if v9 key begin v8 := 1 buyPlant end  #w = pumpkin
			v9 := OCTO_KEY_E if v9 key begin v8 := 2 buyPlant end  #e = lantern
			v9 := OCTO_KEY_A if v9 key begin v8 := 3 buyPlant end  #a = skeleton
			v9 := OCTO_KEY_S if v9 key begin v8 := 4 buyPlant end  #s = glitch
			v9 := OCTO_KEY_D if v9 key begin v8 := 5 buyPlant end  #d = trophy (win game)
			v9 := OCTO_KEY_X if v9 key begin v8 := -1 buyPlant end #x = exit
		end
	again
	
: buyPlant
	if v8 != -1 begin
		
		#Get price
		i := plantBuyPrice
		v0 := va
		v9 := 0
		vb := 3
		loop if v9 < v8 begin 
			i += vb 
			v9 += 1
		again end
		load v5 - v7
		
		#Check if we actually have enough money
		i := money
		load v2 - v4
		v9 := v5
		vb := v6
		vc := v7
		#Copper
		if v2 < v9 then vb += 1
		#Silver
		if v3 < vb then vc += 1
		#Gold
		if v4 >= vc begin 
			#We can afford the thing. :^D
			takeMoney
			if v8 < 5 begin
				getPlantPot
				v2 := v8
				v3 := 0
				v4 := 0
				save v2 - v4
				ReturnToGarden
				
				#Play Dig sound
				i := long sound-dig
				v2 := 1
				audio buzzer := v2
				
			else
				#Wait... did you just buy the trophy? Well, I guess you won!
				jump winScreen
			end
			
		else
			lookingAtGarden := 0
			#We cannot afford the thing. :^(
			#Play error sound
			i := long sound-buzzer
			v2 := 3
			audio buzzer := v2
		end
		
	else ReturnToGarden end
	;
	
: printMoneyOwned
	i := money
	load v2 - v4
	v0 := 56
	v1 := 9
	writeMoney
	;

: getPlantPot 
	if v0 == 29 begin
		i := plantQ
	else
		if v0 == 49 begin
			i := plantW
		else
			if v0 == 69 begin
				i := plantE
			else 
				i := plantA
			end
		end
	end
;

# Draw the garden, and all plants inside of it
: garden
	# Draw pots
	i := pot
	v0 := 25 # X
	v1 := 36 # Y
	loop
		sprite v0 v1 0
		v0 += 20
	if v0 < 89 then again
	
	#Label each pot
	v0 := 31
	v1 := 44
	text "Q"
	v0 += 16
	text "W"
	v0 += 14
	text "E"
	v0 += 16
	text "A"
	
	# Load each plant, and check to see if something is growing. Otherwise, just draw the empty pot
	v0 := 9
	loop
		v0 += 20
		getPlantPot
		load v2 - v4
		drawPlant
	if v0 < 89 then again
;

# I added this timer animation partly because I wanted something that showed that the game was still running, but mostly
# because I thought it would be cool to have a little timelapse/scrolling animation playing in the corner.
: drawTimer
	v0 := LEFT
	v1 := TOP
	plane 2
	i := long timerAnim
	i += timer
	sprite v0 v1 7
	plane 1
;
	
: updatePlants
	v0 := 9
	loop
		v0 += 20
		getPlantPot
		load v2 - v4
	  if v3 < 3 then v4 += 1
	  i := plantGrowthTimePerPhase
	  i += v2
	  load v5 - v5 # Growth time
		if v4 >= v5 begin
			if lookingAtGarden == 1 then drawPlant
			v4 := 0
			v3 += 1
			if lookingAtGarden == 1 then drawPlant
		end
		getPlantPot
		save v2 - v4
	if v0 < 89 then again
;
	
: drawTrophy
	i := long trophy
	v0 := 48
	v1 := 16
	v2 := 32
	v3 := 64
	v5 := 128
	v6 := 0
	loop if v6 < frame begin
		v6 += 1
		i += v5
	again end
	v5 := 32
	sprite v0 v1 0 i += v5
	sprite v0 v2 0 i += v5
	sprite v3 v1 0 i += v5
	sprite v3 v2 0 i += v5
;

: winScreen #You win!
	drawTimer
	clear
	v9 := key loop if v9 key then again
	v0 := 48
	v1 := 9
	text "YOU WIN!"
	v0 := 32 
	v1 := 50
	text "HOLD 1 TO RESTART"
	v9 := OCTO_KEY_1 
	timer := 0
	frame := 0
	drawTrophy
	va := 0
	vb := 16
	loop 
		#Play victory tune
		i := long tune-victory
		vc := 0
		loop if vc < frame begin
			vc += 1
			i += vb
		again end
		audio 
		vc := 20
		buzzer := vc
		
		#Delay to control the speed of the animation
		loop
			vf := delay
			if vf != 0 then
		again
		vf := 20
		delay := vf
		
		#Erase and then redraw trophy animation
		drawTrophy
		frame += 1
		if frame >= 8 then frame := 0
		drawTrophy
		
		if v9 key then jump gameLoop 
	again
;
	
: plants
	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x36 0x08 0x08 0x08 # Dandelion 0
	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x1C 0x1C 0x08 0x08 0x08 0x1C 0x2A #           1
	0x00 0x00 0x00 0x00 0x04 0x0C 0x0E 0x0E 0x15 0x04 0x08 0x08 0x2C 0x7E 0x5A #           2
	0x14 0x2A 0x41 0x81 0x55 0x37 0x0E 0x15 0x04 0x04 0x04 0x08 0x2C 0x7E 0x5A #           3
	
	0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x10 0x38 0x10 0x18 0x70 0x1C 0x76 0xD0 # Pumpkin   0
	0x00 0x00 0x00 0x00 0x00 0x0C 0x14 0x77 0x49 0x36 0x14 0x78 0x10 0x7C 0xD6 #           1
	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x18 0x0C 0x12 0x77 0x17 0x77 0xD0 #           2
	0x00 0x00 0x00 0x00 0x00 0x00 0x10 0x18 0x3C 0x5A 0xA5 0xA5 0xA5 0x5A 0x3C #           3
	
	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x08 0x1C 0x08 0x1C 0x3E # Lantern   0
	0x00 0x00 0x00 0x00 0x00 0x08 0x1C 0x08 0x1C 0x3E 0x1C 0x1C 0x3E 0x08 0x1C #           1
	0x00 0x00 0x08 0x1C 0x08 0x1C 0x3E 0x1C 0x1C 0x3E 0x1C 0x08 0x08 0x1C 0x2A #           2
	0x08 0x1C 0x08 0x1C 0x3E 0x7F 0x22 0x22 0x22 0x7F 0x3E 0x08 0x08 0x6E 0x99 #           3
	
	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x18 0x14 0x24 # Skeleton  0
	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x18 0x14 0x6A 0x5A 0x74 0x94 #           1
	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x3C 0x42 0xA5 0xA5 0x81 0x6E 0x99 #           2
	0x3C 0x42 0xA5 0xA5 0x81 0x4A 0x3C 0x52 0xBD 0xA5 0xBD 0x76 0x34 0x7E 0x99 #           3

:const PLANT_SPRITE_LENGTH 15
:calc PLANT_SPRITESHEET_LENGTH { PLANT_SPRITE_LENGTH * 4 }

: drawPlant
	# It is recommended that you put all of your graphical data at the end of the program.
	# However, I put this code here solely so that we can get the wonderfully weird results 
	# that come from growing glitches.

	if v2 == -1 begin #No plant
		v1 := 36
		i := potTop
		sprite v0 v1 4
		
	else 
		v1 := 25
		i := plants
	
		# Cycle through plants 
		v5 := 0
		v6 := PLANT_SPRITESHEET_LENGTH
		loop if v5 < v2 begin
			v5 += 1
			i += v6
		again end

		# Cycle through growth stages
		v5 := 0
		v6 := PLANT_SPRITE_LENGTH
		loop if v5 < v3 begin
			i += v6
			v5 += 1
		again end

		sprite v0 v1 15
		
		#Draw ! to indicate that plant is ready for harvest
		if v3 == 3 begin
			va := v0
			vb := v1
			v0 -= 3
			v1 -= 3
			text "!"
			v0 := va
			v1 := vb
		end
	end
	;
	
: potTop
	0xFF 0x00 0xFF 0xFF
	
: pot #16x16 sprite, the top row (and also the bottom row ¯\_(0>0)_/¯ ) is empty.
	0x00 0x00 0x70 0x0E 0x80 0x01 0xF0 0x0F 0x8F 0xF1 0x80 0x01 0x70 0x0E 0x4F 0xF2 
	0x40 0x02 0x40 0x02 0x20 0x04 0x20 0x04 0x20 0x04 0x1C 0x38 0x03 0xC0 0x00 0x00
	
: titleScreen
	0x00 0x00 0x18 0xF1 0x3C 0xF9 0x66 0xCD 0x66 0xCD 0x66 0xF9 0x66 0xF1 0x66 0xD9
	0x66 0xD9 0x3C 0xCD 0x18 0xCD 0x00 0x00 0x7E 0xF1 0x7E 0xF9 0x18 0xDD 0x18 0xCD
	0x18 0xCD 0x18 0xCD 0x18 0xCD 0x18 0xDD 0x7E 0xF9 0x7E 0xF1 0x00 0x00 0x3C 0x31
	0x7E 0x31 0x66 0x31 0x60 0x79 0x60 0x79 0x6E 0x79 0x6E 0x79 0x66 0xCD 0x7E 0xCD
	0x3C 0xCD 0x00 0x00 0x60 0x06 0x55 0x08 0x65 0x08 0x52 0x08 0x62 0x06 0x04 0x00
	0x00 0x00 0x00 0x03 0x00 0x02 0x03 0xBB 0x00 0x02 0x00 0x02 0x00 0x00 0x00 0x00
	0x00 0x00 0xE3 0xF6 0xF3 0xF6 0xB8 0xC7 0x98 0xC7 0x98 0xC7 0x98 0xC7 0x98 0xC6
	0xB8 0xC6 0xF3 0xF6 0xE3 0xF6 0x00 0x00 0x8F 0x00 0x8F 0x00 0x8C 0x00 0x8C 0x00
	0x8F 0x00 0x8F 0x00 0x8C 0x00 0x8C 0x00 0xEF 0x00 0xEF 0x00 0x00 0x00 0xE3 0xC7
	0xF3 0xE7 0x9B 0x76 0x9B 0x36 0xF3 0x37 0xE3 0x37 0xB3 0x36 0xB3 0x76 0x9B 0xE7
	0x9B 0xC7 0x00 0x00 0x00 0x80 0x49 0xDE 0x94 0x95 0x94 0x95 0x8A 0x95 0x00 0x00
	0x00 0x00 0x07 0x6C 0x84 0x48 0x37 0x6C 0x24 0x24 0x27 0x6C 0x00 0x00 0x00 0x00
	0x00 0x00 0x63 0x1E 0x63 0x1F 0x63 0x19 0x67 0x99 0xE7 0x9F 0xE7 0x9E 0xE7 0x9B
	0xEC 0xDB 0x6C 0xD9 0x6C 0xD9 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xB3 0x00
	0xB3 0x00 0x3B 0x00 0x3B 0x00 0xBF 0x00 0xBF 0x00 0x37 0x00 0x37 0x00 0xB3 0x00
	0xB3 0x00 0x00 0x00 0x00 0x00 0x23 0x10 0x52 0xA8 0x52 0x98 0x2A 0x88 0x00 0x10
	0x00 0x00 0x20 0x51 0x50 0x51 0x76 0x21 0x55 0x21 0x55 0x21 0x00 0x00 0x00 0x00
	0x00 0x10 0x33 0x00 0x33 0x04 0xB3 0x02 0x9E 0x01 0x1E 0x00 0x0C 0x00 0x0C 0x00
	0x0C 0x00 0x8C 0x9E 0x8C 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
	0x00 0x01 0x00 0x00 0x00 0x04 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
	0x00 0x0A 0x00 0x15 0x01 0xA0 0x06 0x41 0x08 0x20 0x10 0x75 0x0A 0x8E 0x07 0x8D
	0x03 0x54 0x04 0x84 0x00 0x84 0x00 0x84 0x00 0x57 0x03 0x7C 0x07 0xE9 0x0C 0x0E
	0x00 0x00 0x01 0xDC 0x00 0x89 0x94 0x89 0x54 0x89 0x9C 0x88 0x00 0x00 0x00 0x00
	0x00 0x00 0x02 0x00 0x07 0x01 0x02 0x02 0x0F 0x84 0x3F 0xE0 0x64 0xF0 0x44 0x10
	0x24 0x10 0x22 0x23 0x22 0x20 0x17 0x20 0x1F 0xE0 0x07 0x80 0x43 0x08 0x83 0x04
	0x03 0x02 0x03 0x00 0x03 0x00 0x03 0x00 0x03 0x00 0x03 0x00 0x03 0x00 0x03 0x00
	0x03 0x00 0x03 0x00 0x83 0x00 0x03 0x00 0x83 0x00 0x03 0x00 0x03 0x00 0x03 0x00
	0x03 0x00 0x03 0x00 0x03 0x00 0xFF 0xF8 0x07 0x86 0x73 0x3F 0x8F 0xEF 0x00 0x00
	0x00 0x00 0x00 0x00 0xC0 0x00 0x59 0xDC 0xD4 0x00 0x14 0x00 0x00 0x00 0x00 0x00
	0x40 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
	0x00 0x00 0xA0 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
	0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x00 0x00
	0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
	
: timerAnim
	0x78 0x9C 0x0E 0x0E 0x0E 0x9C 0x78 0x00 0x20 0x04 0x00 0x00 0x40 0x10 0x28 0xEE
	0x82 0x44 0x92 0xEE 0x00 0x00 0x40 0x00 0x04 0x00 0x10 0x00 0x00 0x00 0x00 0x40
	0x00 0x02 0x00 0x00 0x40 0x00 0x00 0x10 0x00 0x00 0x00 0x00 0x20 0x00 0x00 0x00 
	0x00 0x04 0x00 0x00 0x00 0x00 0x00 0x18 0x0C 0x0E 0xF8 0x78 0x20 0x30 0xFE 0x92 
	0x24 0x48 0xF0 0x16 0x16 0x16 0xFE 0x00 0x00 0x00 0x00 0xE0 0xD8 0xA4 0x54 0x52 
	0x4A 0x3C 0x08 0x08 0x30 0x20 0x20 0x10 0x38 0x54 0x82 0xD6 0x82 0x54 0x38 0x10 
	0x08 0x08 0x18 0x20 0x20 0x78 0xA4 0x94 0x54 0x4A 0x36 0x0E 0x00 0x00 0x38 0x10 
	0x10 0x28 0x44 0x28 0x10 0x10 0x38 0x00 0x00 0x10 0x82 0x00 0x38 0x44 0x82 0x82 
	0x82 0x44 0x38 0x00 0x82 0x10 0x00 0x00 0x00 0x00 0x10 0xAA 0xC6 0xAA 0x10 0x00 
	0x00 0x00 0x00 0x00 0x02 0x76 0x3E 0xFC 0x78 0x0C 0x06 0x00 0x20 0x70 0xF8 0xF8 
	0x24 0x2E 0xFE 0x82 0x38 0x82 0x28 0xC6 0x00 0x10 0x10 0x20 0x20 0x18 0x00 0x7C 
	0xFE 0xE6 0x7C 0x82 0x7E 0x3E 0x1C 0x3C 0x78 0xF0 0xE0 0x70 0x38 0x0C 0x00 0x00 
	0x38 0x44 0xAA 0xAA 0x44 0x54 0x38 0xFE 0x92 0xFE 0x54 0x7C 0x54 0x38 0x28 0x54 
	0xAA 0xAA 0xAA 0x54 0x54 0x54 0x7C 0x92 0xAA 0x44 0x00 0x00 0x10 0x7C 0xFE 0x44 
	0x44 0x44 0xFE 0x10 0x10 0x10 0x10 0x10 0x10 0x10 0x00 0x10 0x10 0x00 0x10 0x00 
	0x00 0x10 0x00 0x00 0x40 0x00 0x04 0x00 0x00 0x10 0x00 0x80 0x00 0x02 0x00 0x00
	0x78 0x9C 0x0E 0x0E 0x0E 0x9C 0x78 0x00 0x00 

: trophy
	0x00 0x00 0x00 0x00 0x00 0x0F 0x00 0xF0 0x3B 0x2A 0x46 0xFD 0xBA 0x0F 0xA6 0x00
	0xA2 0x01 0xA2 0x02 0xA2 0x06 0x52 0x09 0x5D 0x09 0x23 0x06 0x1C 0x82 0x00 0x81
	0x00 0x65 0x00 0x1A 0x00 0x07 0x00 0x03 0x00 0x02 0x00 0x03 0x00 0x02 0x00 0x02
	0x00 0x0E 0x00 0x3E 0x00 0x3F 0x00 0x2A 0x00 0x35 0x00 0x2A 0x00 0x1D 0x00 0x07
	0x00 0x00 0x00 0x00 0xF0 0x00 0x0F 0x00 0xA8 0xDC 0x5F 0x62 0xF0 0x5D 0x00 0xE5
	0x80 0x45 0x40 0xC5 0x61 0x45 0x92 0xCA 0x91 0xBA 0x62 0xC4 0x45 0x38 0xAB 0x00
	0x56 0x00 0xB8 0x00 0xE0 0x00 0x40 0x00 0xC0 0x00 0x40 0x00 0x40 0x00 0x40 0x00
	0x70 0x00 0x7C 0x00 0xF4 0x00 0xAC 0x00 0x5C 0x00 0xFC 0x00 0xF8 0x00 0xE0 0x00
	0x00 0x00 0x01 0x80 0x02 0x4F 0x05 0xF0 0x07 0x15 0x06 0xFA 0x06 0x0F 0x02 0x30
	0x02 0x48 0x02 0xCC 0x02 0xB2 0x02 0xB2 0x01 0x4E 0x01 0x28 0x00 0x90 0x00 0x80
	0x00 0x6A 0x00 0x1D 0x00 0x07 0x00 0x02 0x00 0x03 0x00 0x02 0x00 0x02 0x00 0x02
	0x00 0x0E 0x00 0x3E 0x00 0x2F 0x00 0x35 0x00 0x2A 0x00 0x35 0x00 0x1B 0x00 0x07
	0x00 0x00 0x00 0x00 0xF0 0x00 0x0F 0x00 0x54 0xC0 0xBF 0x40 0xF1 0xC0 0x0E 0x40
	0x01 0x40 0x01 0x40 0x01 0x40 0x02 0x40 0x0A 0x80 0x14 0x80 0x39 0x00 0x57 0x00
	0xAE 0x00 0x78 0x00 0xE0 0x00 0xC0 0x00 0x40 0x00 0xC0 0x00 0x40 0x00 0x40 0x00
	0x70 0x00 0x7C 0x00 0xFC 0x00 0x54 0x00 0xAC 0x00 0x7C 0x00 0xF8 0x00 0xE0 0x00
	0x00 0x01 0x00 0x02 0x00 0x0F 0x00 0xF0 0x03 0x2A 0x02 0xFD 0x03 0x0F 0x02 0x82
	0x02 0x82 0x03 0x42 0x03 0x42 0x02 0x82 0x01 0x82 0x01 0x82 0x00 0x82 0x00 0x82
	0x00 0x65 0x00 0x1A 0x00 0x07 0x00 0x03 0x00 0x02 0x00 0x03 0x00 0x02 0x00 0x02
	0x00 0x0E 0x00 0x3E 0x00 0x3F 0x00 0x2A 0x00 0x35 0x00 0x2A 0x00 0x1D 0x00 0x07
	0x80 0x00 0x40 0x00 0xF0 0x00 0x0F 0x00 0xA8 0xC0 0x5F 0x40 0xF0 0x40 0x40 0xC0
	0x40 0x40 0x40 0xC0 0x41 0x40 0x42 0xC0 0x41 0x80 0x42 0x80 0x45 0x00 0x6B 0x00
	0xD6 0x00 0xB8 0x00 0xE0 0x00 0x40 0x00 0xC0 0x00 0x40 0x00 0x40 0x00 0x40 0x00
	0x70 0x00 0x7C 0x00 0xF4 0x00 0xAC 0x00 0x5C 0x00 0xFC 0x00 0xF8 0x00 0xE0 0x00
	0x00 0x00 0x00 0x00 0x00 0x0F 0x00 0xF0 0x03 0x15 0x02 0xFA 0x03 0x8F 0x02 0x70
	0x02 0x80 0x02 0x80 0x02 0x80 0x02 0x40 0x01 0x50 0x01 0x28 0x00 0x98 0x00 0xF4
	0x00 0x6A 0x00 0x1D 0x00 0x07 0x00 0x02 0x00 0x03 0x00 0x02 0x00 0x02 0x00 0x02
	0x00 0x0E 0x00 0x3E 0x00 0x2F 0x00 0x35 0x00 0x2A 0x00 0x35 0x00 0x1B 0x00 0x07
	0x00 0x00 0x01 0x80 0xF2 0x40 0x0F 0xA0 0x54 0xE0 0xBF 0x60 0xF0 0x60 0x00 0x40
	0x00 0xC0 0x01 0x40 0x00 0xC0 0x01 0x40 0x02 0x80 0x05 0x80 0x0B 0x00 0x55 0x00
	0xAE 0x00 0x78 0x00 0xE0 0x00 0xC0 0x00 0x40 0x00 0xC0 0x00 0x40 0x00 0x40 0x00
	0x70 0x00 0x7C 0x00 0xFC 0x00 0x54 0x00 0xAC 0x00 0x7C 0x00 0xF8 0x00 0xE0 0x00
	0x00 0x00 0x00 0x00 0x00 0x0F 0x00 0xF0 0x3B 0x2A 0x46 0xFD 0xBA 0x0F 0xA6 0x00
	0xA2 0x00 0xA2 0x00 0xA2 0x00 0x52 0x00 0x5D 0x00 0x23 0x00 0x1C 0x80 0x00 0x80
	0x00 0x65 0x00 0x1A 0x00 0x07 0x00 0x03 0x00 0x02 0x00 0x03 0x00 0x02 0x00 0x02
	0x00 0x0E 0x00 0x3E 0x00 0x3F 0x00 0x2A 0x00 0x35 0x00 0x2A 0x00 0x1D 0x00 0x07
	0x00 0x00 0x00 0x00 0xF0 0x00 0x0F 0x00 0xA8 0xDC 0x5F 0x62 0xF0 0x5D 0x00 0xE5
	0x00 0x45 0x00 0xC5 0x01 0x45 0x02 0xCA 0x01 0xBA 0x02 0xC4 0x05 0x38 0x2B 0x00
	0x56 0x00 0xB8 0x00 0xE0 0x00 0x40 0x00 0xC0 0x00 0x40 0x00 0x40 0x00 0x40 0x00
	0x70 0x00 0x7C 0x00 0xF4 0x00 0xAC 0x00 0x5C 0x00 0xFC 0x00 0xF8 0x00 0xE0 0x00
	0x00 0x00 0x01 0x80 0x02 0x4F 0x05 0xF0 0x07 0x15 0x06 0xFA 0x06 0x0F 0x02 0x00
	0x02 0x00 0x02 0x00 0x02 0x00 0x02 0x00 0x01 0x00 0x01 0x00 0x00 0x80 0x00 0x80
	0x00 0x6A 0x00 0x1D 0x00 0x07 0x00 0x02 0x00 0x03 0x00 0x02 0x00 0x02 0x00 0x02
	0x00 0x0E 0x00 0x3E 0x00 0x2F 0x00 0x35 0x00 0x2A 0x00 0x35 0x00 0x1B 0x00 0x07
	0x00 0x00 0x00 0x00 0xF0 0x00 0x0F 0x00 0x54 0xC0 0xBF 0x40 0xF1 0xC0 0x0E 0x40
	0x01 0x40 0x01 0x40 0x01 0x40 0x02 0x40 0x0A 0x80 0x14 0x80 0x39 0x00 0x57 0x00
	0xAE 0x00 0x78 0x00 0xE0 0x00 0xC0 0x00 0x40 0x00 0xC0 0x00 0x40 0x00 0x40 0x00
	0x70 0x00 0x7C 0x00 0xFC 0x00 0x54 0x00 0xAC 0x00 0x7C 0x00 0xF8 0x00 0xE0 0x00
	0x00 0x01 0x00 0x02 0x00 0x0F 0x00 0xF0 0x03 0x2A 0x02 0xFD 0x02 0x0F 0x02 0x02
	0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x02 0x01 0x02 0x01 0x02 0x00 0x82 0x00 0x82
	0x00 0x65 0x00 0x1A 0x00 0x07 0x00 0x03 0x00 0x02 0x00 0x03 0x00 0x02 0x00 0x02
	0x00 0x0E 0x00 0x3E 0x00 0x3F 0x00 0x2A 0x00 0x35 0x00 0x2A 0x00 0x1D 0x00 0x07
	0x80 0x00 0x40 0x00 0xF0 0x00 0x0F 0x00 0xA8 0xC0 0x5F 0x40 0xF0 0xC0 0x41 0xC0
	0x41 0x40 0x42 0xC0 0x43 0xC0 0x43 0xC0 0x41 0x80 0x43 0x80 0x45 0x00 0x6B 0x00
	0xD6 0x00 0xB8 0x00 0xE0 0x00 0x40 0x00 0xC0 0x00 0x40 0x00 0x40 0x00 0x40 0x00
	0x70 0x00 0x7C 0x00 0xF4 0x00 0xAC 0x00 0x5C 0x00 0xFC 0x00 0xF8 0x00 0xE0 0x00
	0x00 0x00 0x00 0x00 0x00 0x0F 0x00 0xF0 0x03 0x15 0x02 0xFA 0x03 0x8F 0x02 0x70
	0x02 0x80 0x02 0x80 0x02 0x80 0x02 0x40 0x01 0x50 0x01 0x28 0x00 0x98 0x00 0xF4
	0x00 0x6A 0x00 0x1D 0x00 0x07 0x00 0x02 0x00 0x03 0x00 0x02 0x00 0x02 0x00 0x02
	0x00 0x0E 0x00 0x3E 0x00 0x2F 0x00 0x35 0x00 0x2A 0x00 0x35 0x00 0x1B 0x00 0x07
	0x00 0x00 0x01 0x80 0xF2 0x40 0x0F 0xA0 0x54 0xE0 0xBF 0x60 0xF0 0x60 0x0C 0x40
	0x12 0xC0 0x33 0x40 0x4D 0xC0 0x4D 0x40 0x72 0x80 0x15 0x80 0x0B 0x00 0x55 0x00
	0xAE 0x00 0x78 0x00 0xE0 0x00 0xC0 0x00 0x40 0x00 0xC0 0x00 0x40 0x00 0x40 0x00
	0x70 0x00 0x7C 0x00 0xFC 0x00 0x54 0x00 0xAC 0x00 0x7C 0x00 0xF8 0x00 0xE0 0x00
	
: block-16
	0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
	0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
	0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
	0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
: block-12
	0xFF 0xF0 0xFF 0xF0 0xFF 0xF0 0xFF 0xF0
	0xFF 0xF0 0xFF 0xF0 0xFF 0xF0 0xFF 0xF0
	0xFF 0xF0 0xFF 0xF0 0xFF 0xF0 0xFF 0xF0
	0xFF 0xF0 0xFF 0xF0 0xFF 0xF0 0xFF 0xF0
	
: sound-buzzer
	0xFF 0xFF 0xF8 0x00 0x00 0x7F 0xFF 0xF8 0x00 0x00 0x7F 0xFF 0xF8 0x00 0x00 0x7F
	
: sound-yay
	0xF8 0x78 0x78 0x78 0x78 0x78 0x78 0x78 0x78 0x78 0x7C 0x3C 0x3C 0x3C 0x3C 0x3C
	
: sound-dig
	0x73 0xFE 0xFF 0x7D 0x8D 0xC7 0xFF 0xDB 0xDD 0x7F 0xFE 0x77 0xDD 0xFB 0xFD 0xDF
	
: tune-victory
	0xFF 0x00 0xFE 0x01 0xFE 0x03 0xFC 0x03 0xF8 0x07 0xF8 0x0F 0xF0 0x0F 0xE0 0x1F
	0xFF 0x80 0x7F 0x80 0x7F 0x80 0x7F 0x80 0x7F 0x80 0x7F 0xC0 0x3F 0xC0 0x3F 0xC0
	0xFF 0xC0 0x1F 0xF0 0x07 0xFC 0x01 0xFF 0x00 0x7F 0xC0 0x1F 0xF8 0x03 0xFE 0x00
	0xFF 0xE0 0x07 0xFE 0x00 0x7F 0xF0 0x03 0xFF 0x00 0x3F 0xF0 0x01 0xFF 0x80 0x1F
	0xFF 0x00 0xFE 0x01 0xFE 0x03 0xFC 0x03 0xF8 0x07 0xF8 0x0F 0xF0 0x0F 0xE0 0x1F
	0xFE 0x03 0xF8 0x0F 0xE0 0x7F 0x01 0xFC 0x07 0xE0 0x3F 0x80 0xFE 0x07 0xF0 0x1F
	0xFC 0x0F 0xC1 0xF8 0x1F 0x83 0xF0 0x3E 0x07 0xE0 0x7C 0x0F 0xC0 0xF8 0x1F 0x83
	0xFE 0x07 0xE0 0x7E 0x07 0xE0 0x7E 0x07 0xE0 0x7E 0x07 0xF0 0x3F 0x03 0xF0 0x3F
	
	